var $nextStep = $("#nextStep"); 
var $assignee = $("#assignee"); 


$(function(){
	
	$nextStep.bind("change",function(){
		var value = $nextStep.val();
		getTaskNodeAssignees(taskId,value);
	})
	
})

//获取任务处理人列表
function getTaskNodeAssignees(taskId,taskNodeName){
	
	var data = {"taskId":taskId,"taskNodeName":taskNodeName}
	
	$.ajax({
		url: prefix + "/getTaskNodeAssignees/",
		data:data,
		type: 'POST',
		success: function (result) {
			setAssigneeOption(result.data);
		}
	});
}

//设置任务处理人
function setAssigneeOption(data){
	//清除选项
	$assignee.empty();
	
	$.each(data,function(key,val){
		
		var name = val.name;
		
		$assignee.append(new Option(name, name));
	})
}